Try to fix intermittent test failures
authorMatt Brubeck <mbrubeck@limpet.net>
Sat, 13 Sep 2014 04:49:35 +0000 (21:49 -0700)
committerMatt Brubeck <mbrubeck@limpet.net>
Sat, 13 Sep 2014 15:27:15 +0000 (08:27 -0700)
Travis is showing intermittent failures in
`test_cargo_compile_path_deps::path_dep_build_cmd` and
`test_cargo_compile_git_deps::git_dep_build_cmd` (added in #561 and #563).

I haven't managed to reproduce these failures locally, but I suspect the tests
are timing-sensitive.  This tries to guarantee that the timestamps during the
two operations can't be the same.

tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_path_deps.rs

index 9eb6a69126777b248ef9581e2646668fac9c5880..c50a255d6ff20039c2c40be054eaea5efa4949d2 100644 (file)
@@ -1181,6 +1181,8 @@ test!(git_dep_build_cmd {
         "#)
     }).assert();
 
+    p.root().join("bar").move_into_the_past().assert();
+
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
         execs().with_status(0));
 
index 18be3e75aacc3ce05d225f8aa88c0aba60cb263f..c96e3dcf34b38dd47b85f57bf14627e721b40430 100644 (file)
@@ -667,7 +667,10 @@ test!(path_dep_build_cmd {
             pub fn gimme() -> int { 0 }
         "#);
 
-    assert_that(p.cargo_process("build"),
+    p.build();
+    p.root().join("bar").move_into_the_past().assert();
+
+    assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
         execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
                                      {} foo v0.5.0 ({})\n",
                                     COMPILING, p.url(),